package com.example.demo.user;

import com.example.demo.Demo01AccountMessage;
import com.example.demo.Demo01Producer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private Demo01Producer producer;

    //用户信息修改 发送消息到订单服务
    @PostMapping("/user/send")
    private String updateUser(@RequestBody  Demo01AccountMessage user){
        producer.syncSend(user);
        return "success";
    }
}
